home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / asm_n_z.zip / RAMADE.ASM < prev    next >
Assembly Source File  |  1987-01-04  |  21KB  |  388 lines

  1. page ,132 ;
  2. title RAMADE - Initialize DOS memory to use segments A,D and E
  3. comment *
  4. ┌──────────────────────────────────────────────────────────────────────────────┐
  5. │           Name: ramade                                                       │
  6. │                                                                              │
  7. │       Function: This program enables the utilization of 192 k of RAM in      │
  8. │                 addition to the 640 k normal maximum for a PC.  The          │
  9. │                 additional RAM must be installed at segment addresses A000,  │
  10. │                 D000 and E000.  The 64k of RAM in segment A is contiguous    │
  11. │                 with the normal 640k and is used simply by extending the     │
  12. │                 memory size above 640.  The 128k in segments D and E is not  │
  13. │                 contiguous with the rest of RAM.  It is used for loading     │
  14. │                 various resident extensions, thus freeing up RAM in the main │
  15. │                 area (0-704k).                                               │
  16. │                                                                              │
  17. │    Description: The memory size is set to the end of segment E by resetting  │
  18. │                 the bios memory size and rebooting.  Storage in segments A,  │
  19. │                 D and E is tested and cleared.  Miscompares are detected,    │
  20. │                 but no attempt is made to handle the more common case of     │
  21. │                 parity checks during the test.                               │
  22. │                                                                              │
  23. │                 Resident extensions are loaded in segments D and E by a      │
  24. │                 secondary command processor which is invoded by RAMADE.      │
  25. │                 After issuing a SETBLOCK function call to free the 128 K     │
  26. │                 bytes in segments D and E, RAMADE invokes the secondary      │
  27. │                 command processor with a command of 'AUTOLOAD'.  This should │
  28. │                 be a bat file which contains the commands to load the        │
  29. │                 resident extensions.                                         │
  30. │                                                                              │
  31. │                 After loading the resident extensions, RAMADE issues other   │
  32. │                 memory management function calls which leave segments B and  │
  33. │                 C allocated and free up unused memory below segment B.       │
  34. │                                                                              │
  35. │                 In addition, the warm boot flag in low storage is reset.     │
  36. │                 The system bios sets this flag when doing a ctl-alt-del      │
  37. │                 reset, but never clears it, apparently relying on power      │
  38. │                 dropping to clear the area.  (I've recently installed 256k   │
  39. │                 chips on my system board, and after this installation,       │
  40. │                 sometimes my system was warm booting when it should have     │
  41. │                 been cold booting after turning the power off briefly.)      │
  42. └──────────────────────────────────────────────────────────────────────────────┘
  43. *
  44. page
  45. comment *
  46. ┌──────────────────────────────────────────────────────────────────────────────┐
  47. │         Inputs: Memory size word in low storage                              │
  48. │                                                                              │
  49. │        Outputs: Memory size word in low storage                              │
  50. │                 Reset flag word in low storage                               │
  51. │                                                                              │
  52. │   Return Codes: First entry - none, exit via reboot.                         │
  53. │                 Second entry - always 0.                                     │
  54. │                                                                              │
  55. │   Dependancies: Low storage areas - see lowstg segment.                      │
  56. │                 GWASMC macros.                                               │
  57. │                 Assumes 832 k installed as described above.                  │
  58. │                 AUTOLOAD bat file invoked.                                   │
  59. │                                                                              │
  60. │  Entry Linkage: Standard COM module invocation                               │
  61. │                                                                              │
  62. │   Exit Linkage: Int 21 function 31 (terminate and remain resident)           │
  63. │                 or reboot via int 19.                                        │
  64. │                                                                              │
  65. │ Change History: Ver  0.00   10/26/85   Under development                     │
  66. │                      1.00   11/03/85   First release                         │
  67. │                      1.10   11/05/85   Changed address equates to table      │
  68. │                      1.20   06/25/86   Save/restore regs around exec cmd     │
  69. │                                        processor for DOS 2.1 bug             │
  70. │                      1.21   12/05/86   Zap mem alloc table from "M" to "Z"   │
  71. │                                        This make DOS forget about discontig. │
  72. └──────────────────────────────────────────────────────────────────────────────┘
  73. *
  74. page
  75. ;══════════════════════════════════════════════════════════════════════════════
  76. ; Get Macros and other standard setups
  77. ;──────────────────────────────────────┐
  78. if1                                    ;
  79. include gwasmc.mac                     ;
  80. endif                                  ;
  81. .radix   16                            ;
  82.                                        ;────────────────────────────────────────
  83. ;═══════════════════════════════════════════════════════════════════════════════
  84. ; Map low storage
  85. ;──────────────────────────────────────┐
  86. lowstg   segment  at 0                 ;
  87.          org      413                  ;
  88. mem_size dw                            ; Memory size in K, set by bios and us
  89.          org      472                  ;
  90. rst_flag dw                            ; Reset flag - set to 1234 by bios to
  91.                                        ; indicate warm boot in process.
  92. lowstg   ends                          ;
  93.                                        ;────────────────────────────────────────
  94. page
  95. ;═══════════════════════════════════════════════════════════════════════════════
  96. ; Global data segment entries and equates
  97. ;──────────────────────────────────────┐
  98. cgroup   group    codeseg,dataseg      ;
  99. dataseg  segment  'data'               ;
  100.                                        ;
  101.          db       'RAMADE  1.21 - IBM Internal Use Only ',0dh,0a
  102.          db       'Cornell Wright - WRIGHT at PKEDVM8 ',0dh,0a
  103.                                        ;
  104.                                        ;
  105. if ($-dataseg) mod 10h                 ; align to paragraph boundry
  106.          org      ($-dataseg)+10h-(($-dataseg) mod 10h)
  107. endif                                  ;
  108.                                        ;
  109.          db       'ADDR TAB'           ;
  110. mconend  dw       0b000          ; +00   End of contiguous memory (para addr)
  111. mdissta  dw       0d000          ; +02   Start of discontiguous memory
  112. mdisend  dw       0f000          ; +04   End of discontiguous memory
  113.                                  ;
  114. mseg1    dw       0a000          ; +06   First segment to clear and test
  115. mseg1l   dw       08000          ; +08   First segment length in words
  116.                                  ;
  117. mseg2    dw       0d000          ; +0a   Second  "           "
  118. mseg2l   dw       08000          ; +0c     "     "           "
  119.                                  ;
  120. mseg3    dw       0e000          ; +0e   Third   "           "
  121. mseg3l   dw       08000          ; +10     "     "           "
  122.                                        ;
  123. dataseg  ends                          ;
  124. ;──────────────────────────────────────┘
  125. ; PS